home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-11-11 | 7.3 KB | 394 lines | [TEXT/MPS ] |
- ;
- ; File: Controls.a
- ;
- ; Copyright: © 1984-1994 by Apple Computer, Inc.
- ; All rights reserved.
- ;
- ; Version: Universal Interfaces 2.0a3 ETO #16, MPW prerelease. Friday, November 11, 1994.
- ;
- ; Bugs?: If you find a problem with this file, send the file and version
- ; information (from above) and the problem description to:
- ;
- ; Internet: apple.bugs@applelink.apple.com
- ; AppleLink: APPLE.BUGS
- ;
- ;
-
- IF &TYPE('__CONTROLS__') = 'UNDEFINED' THEN
- __CONTROLS__ SET 1
-
-
- IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
- include 'Types.a'
- ENDIF
- ; include 'ConditionalMacros.a' ;
-
- IF &TYPE('__QUICKDRAW__') = 'UNDEFINED' THEN
- include 'Quickdraw.a'
- ENDIF
- ; include 'MixedMode.a' ;
- ; include 'QuickdrawText.a' ;
-
- IF &TYPE('__MENUS__') = 'UNDEFINED' THEN
- include 'Menus.a'
- ENDIF
- ; include 'Memory.a' ;
- ; include 'Events.a' ;
- ; include 'OSUtils.a' ;
- IF &TYPE('STRICT_CONTROLS') = 'UNDEFINED' THEN
- STRICT_CONTROLS: SET 0
- ENDIF
-
- pushButProc EQU 0
- checkBoxProc EQU 1
- radioButProc EQU 2
- scrollBarProc EQU 16
- popupMenuProc EQU 1008
-
- ;
- ; Standard System 7 CDEF variant codes for use in control creation API's
- ;
- useWFont EQU 8
-
- IF OLDROUTINENAMES THEN
- inLabel EQU 1
- inMenu EQU 2
- inTriangle EQU 4
- inButton EQU 10
- inCheckBox EQU 11
- inUpButton EQU 20
- inDownButton EQU 21
- inPageUp EQU 22
- inPageDown EQU 23
- inThumb EQU 129
-
- ENDIF
- kNoHiliteControlPart EQU 0
- kInLabelControlPart EQU 1
- kInMenuControlPart EQU 2
- kInTriangleControlPart EQU 4
- kInButtonControlPart EQU 10
- kInCheckBoxControlPart EQU 11
- kInUpButtonControlPart EQU 20
- kInDownButtonControlPart EQU 21
- kInPageUpControlPart EQU 22
- kInPageDownControlPart EQU 23
- kInIndicatorControlPart EQU 129
- kReservedControlPart EQU 254
- kControlInactiveControlPart EQU 255
-
- ;
- ; System 7 Pop-up menu variants
- ;
- popupFixedWidth EQU 1 << 0
- popupVariableWidth EQU 1 << 1
- popupUseAddResMenu EQU 1 << 2
- popupUseWFont EQU 1 << 3
-
- ;
- ; System 7 Pop-up menu title styles
- ;
- popupTitleBold EQU 1 << 8
- popupTitleItalic EQU 1 << 9
- popupTitleUnderline EQU 1 << 10
- popupTitleOutline EQU 1 << 11
- popupTitleShadow EQU 1 << 12
- popupTitleCondense EQU 1 << 13
- popupTitleExtend EQU 1 << 14
- popupTitleNoStyle EQU 1 << 15
-
- ;
- ; System 7 Pop-up menu label justifications
- ;
- popupTitleLeftJust EQU $00000000
- popupTitleCenterJust EQU $00000001
- popupTitleRightJust EQU $000000FF
-
- ;
- ; Axis constraints for DragGrayRgn call
- ;
- noConstraint EQU kNoConstraint
- hAxisOnly EQU 1
- vAxisOnly EQU 2
-
- ;
- ; Messages for the control defproc
- ;
- drawCntl EQU 0
- testCntl EQU 1
- calcCRgns EQU 2
- initCntl EQU 3
- dispCntl EQU 4
- posCntl EQU 5
- thumbCntl EQU 6
- dragCntl EQU 7
- autoTrack EQU 8
- calcCntlRgn EQU 10
- calcThumbRgn EQU 11
- drawThumbOutline EQU 12
-
- ;
- ; Control color table part codes
- ;
- cFrameColor EQU 0
- cBodyColor EQU 1
- cTextColor EQU 2
- cThumbColor EQU 3
-
- IF STRICT_CONTROLS THEN
- ELSE
- ENDIF
- ;
- ; Define the main entry point to the standard action proc pointer
- ;
- CtlCTab RECORD 0
- ccSeed ds.l 1
- ccRider ds.w 1
- ctSize ds.w 1
- ctTable ds.b 4 * ColorSpec
- sizeof EQU 40
- ENDR
-
- IF ¬ STRICT_CONTROLS THEN
- ControlRecord RECORD 0
- nextControl ds.l 1
- contrlOwner ds.l 1
- contrlRect ds Rect
- contrlVis ds.b 1
- contrlHilite ds.b 1
- contrlValue ds.w 1
- contrlMin ds.w 1
- contrlMax ds.w 1
- contrlDefProc ds.l 1
- contrlData ds.l 1
- contrlAction ds.l 1
- contrlRfCon ds.l 1
- contrlTitle ds.l 64
- sizeof EQU 296
- ENDR
-
- ;
- ; Define private pop-up menu storage (hung off contrlData field in ControlRecord).
- ;
- PopupPrivateData RECORD 0
- mHandle ds.l 1
- mID ds.w 1
- sizeof EQU 6
- ENDR
-
- ENDIF
- AuxCtlRec RECORD 0
- acNext ds.l 1
- acOwner ds.l 1
- acCTable ds.l 1
- acFlags ds.w 1
- acReserved ds.l 1
- acRefCon ds.l 1
- sizeof EQU 22
- ENDR
-
- ;
- ; Structure used in __TrackControl() - See IM I-332
- ;
- IndicatorDragConstraint RECORD 0
- limitRect ds Rect
- slopRect ds Rect
- axis ds.w 1
- sizeof EQU 18
- ENDR
-
- IF GENERATING68K THEN
- _NewControl: OPWORD $A954
- ELSE
- IMPORT NewControl
- ENDIF
-
- IF GENERATING68K THEN
- _SetControlTitle: OPWORD $A95F
- ELSE
- IMPORT SetControlTitle
- ENDIF
-
- IF GENERATING68K THEN
- _GetControlTitle: OPWORD $A95E
- ELSE
- IMPORT GetControlTitle
- ENDIF
-
- IF GENERATING68K THEN
- _GetNewControl: OPWORD $A9BE
- ELSE
- IMPORT GetNewControl
- ENDIF
-
- IF GENERATING68K THEN
- _DisposeControl: OPWORD $A955
- ELSE
- IMPORT DisposeControl
- ENDIF
-
- IF GENERATING68K THEN
- _KillControls: OPWORD $A956
- ELSE
- IMPORT KillControls
- ENDIF
-
- IF GENERATING68K THEN
- _HideControl: OPWORD $A958
- ELSE
- IMPORT HideControl
- ENDIF
-
- IF GENERATING68K THEN
- _ShowControl: OPWORD $A957
- ELSE
- IMPORT ShowControl
- ENDIF
-
- IF GENERATING68K THEN
- _DrawControls: OPWORD $A969
- ELSE
- IMPORT DrawControls
- ENDIF
-
- IF GENERATING68K THEN
- _Draw1Control: OPWORD $A96D
- ELSE
- IMPORT Draw1Control
- ENDIF
-
- IF GENERATING68K THEN
- _HiliteControl: OPWORD $A95D
- ELSE
- IMPORT HiliteControl
- ENDIF
-
- IF GENERATING68K THEN
- _UpdateControls: OPWORD $A953
- ELSE
- IMPORT UpdateControls
- ENDIF
-
- IF GENERATING68K THEN
- _MoveControl: OPWORD $A959
- ELSE
- IMPORT MoveControl
- ENDIF
-
- IF GENERATING68K THEN
- _SizeControl: OPWORD $A95C
- ELSE
- IMPORT SizeControl
- ENDIF
-
- IF GENERATING68K THEN
- _SetControlValue: OPWORD $A963
- ELSE
- IMPORT SetControlValue
- ENDIF
-
- IF GENERATING68K THEN
- _GetControlValue: OPWORD $A960
- ELSE
- IMPORT GetControlValue
- ENDIF
-
- IF GENERATING68K THEN
- _SetControlMinimum: OPWORD $A964
- ELSE
- IMPORT SetControlMinimum
- ENDIF
-
- IF GENERATING68K THEN
- _GetControlMinimum: OPWORD $A961
- ELSE
- IMPORT GetControlMinimum
- ENDIF
-
- IF GENERATING68K THEN
- _SetControlMaximum: OPWORD $A965
- ELSE
- IMPORT SetControlMaximum
- ENDIF
-
- IF GENERATING68K THEN
- _GetControlMaximum: OPWORD $A962
- ELSE
- IMPORT GetControlMaximum
- ENDIF
-
- IF ¬ STRICT_CONTROLS THEN
- IF GENERATING68K THEN
- _GetAuxiliaryControlRecord: OPWORD $AA44
- ELSE
- IMPORT GetAuxiliaryControlRecord
- ENDIF
-
- ENDIF
- IF GENERATING68K THEN
- _SetControlReference: OPWORD $A95B
- ELSE
- IMPORT SetControlReference
- ENDIF
-
- IF GENERATING68K THEN
- _GetControlReference: OPWORD $A95A
- ELSE
- IMPORT GetControlReference
- ENDIF
-
- IF GENERATING68K THEN
- _SetControlAction: OPWORD $A96B
- ELSE
- IMPORT SetControlAction
- ENDIF
-
- IF GENERATING68K THEN
- _GetControlAction: OPWORD $A96A
- ELSE
- IMPORT GetControlAction
- ENDIF
-
- IF GENERATING68K THEN
- _DragControl: OPWORD $A967
- ELSE
- IMPORT DragControl
- ENDIF
-
- IF GENERATING68K THEN
- _TestControl: OPWORD $A966
- ELSE
- IMPORT TestControl
- ENDIF
-
- IF GENERATING68K THEN
- _FindControl: OPWORD $A96C
- ELSE
- IMPORT FindControl
- ENDIF
-
- IF GENERATING68K THEN
- _SetControlColor: OPWORD $AA43
- ELSE
- IMPORT SetControlColor
- ENDIF
-
- IF GENERATING68K THEN
- _GetControlVariant: OPWORD $A809
- ELSE
- IMPORT GetControlVariant
- ENDIF
-
- ;
- ; When using the TrackControl() call when tracking an indicator, the
- ; actionProc parameter (type ControlActionUPP) should be replaced by
- ; a parameter of type DragGrayRgnUPP (defined in Quickdraw.<header>).
- ;
- IF GENERATING68K THEN
- _TrackControl: OPWORD $A968
- ELSE
- IMPORT TrackControl
- ENDIF
-
- ENDIF ; __CONTROLS__
-